const { Schema, model, Types } = require('mongoose')
const { UserModel } = require("./model/userModels/userModel");
const avatarModel = require('./model/fileModels/avatarModel')
module.exports = {
  uploadAvatar: async (userId, file) => {
    const user = await UserModel.findOne({userId})
    const params ={
      avatarId: user.userId,
      ...file
    }
    const data = await avatarModel.create(params)
    if (data) {
      return data
    }
  },
}